package WrenchDb.DAL.Entities;
// Generated 8-dic-2013 14.59.34 by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.hibernate.annotations.Generated;
import org.hibernate.annotations.GenerationTime;

/**
 * WdbEntity generated by hbm2java
 */
@Entity
@Table(name="wdb_entity"
    ,schema="public"
    , uniqueConstraints = @UniqueConstraint(columnNames={"entity_name", "application_id"}) 
)
public class WdbEntity  implements java.io.Serializable {


     private long entityId;
     private WdbApplication wdbApplication;
     private String entityName;
     private String entityDesc;
     private Boolean isManaged;
     private Set<WdbProperty> wdbProperties = new HashSet<WdbProperty>(0);

    public WdbEntity() {
    }

	
    public WdbEntity(long entityId, WdbApplication wdbApplication, String entityName) {
        this.entityId = entityId;
        this.wdbApplication = wdbApplication;
        this.entityName = entityName;
    }
    public WdbEntity(long entityId, WdbApplication wdbApplication, String entityName, String entityDesc, Boolean isManaged, Set<WdbProperty> wdbProperties) {
       this.entityId = entityId;
       this.wdbApplication = wdbApplication;
       this.entityName = entityName;
       this.entityDesc = entityDesc;
       this.isManaged = isManaged;
       this.wdbProperties = wdbProperties;
    }
   
     @Id 
          @Generated(GenerationTime.INSERT)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name="entity_id", unique=true, nullable=false)
    public long getEntityId() {
        return this.entityId;
    }
    
    public void setEntityId(long entityId) {
        this.entityId = entityId;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="application_id", nullable=false)
    public WdbApplication getWdbApplication() {
        return this.wdbApplication;
    }
    
    public void setWdbApplication(WdbApplication wdbApplication) {
        this.wdbApplication = wdbApplication;
    }
    
    @Column(name="entity_name", nullable=false, length=200)
    public String getEntityName() {
        return this.entityName;
    }
    
    public void setEntityName(String entityName) {
        this.entityName = entityName;
    }
    
    @Column(name="entity_desc", length=1000)
    public String getEntityDesc() {
        return this.entityDesc;
    }
    
    public void setEntityDesc(String entityDesc) {
        this.entityDesc = entityDesc;
    }
    
    @Column(name="is_managed")
    public Boolean getIsManaged() {
        return this.isManaged;
    }
    
    public void setIsManaged(Boolean isManaged) {
        this.isManaged = isManaged;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="wdbEntity")
    public Set<WdbProperty> getWdbProperties() {
        return this.wdbProperties;
    }
    
    public void setWdbProperties(Set<WdbProperty> wdbProperties) {
        this.wdbProperties = wdbProperties;
    }




}


